#include "../include/EnergyReport.h"

EnergyReport::EnergyReport() : Report() {}

EnergyReport::EnergyReport(const Poco::DateTime * const date)
		: Report(date) {}

EnergyReport::~EnergyReport(){
	delete date;
}


//returns posotive int if this happens before other;
//negative if other happens before this; 0 otherwise.
//Two EnergyReport's of same date, are equal
int EnergyReport::compareTo(Events & other) const {
	int ans = 0;
	ans = (*(other.date) - *(this->date)).days(); //compare dates
	if (ans == 0)//dates are the same
		ans = other.getType() - this->type;//compare event type
	return ans;
}

Events::eEvents EnergyReport::getType() const {
	return type;
}
